<form data-auto-form action="{:request()->url()}"  method="post">
    <input type="hidden" name="id" value="{$model.id|default=''}">
    <div class="form-group">
        <label class="col-xs-12" for="username">用户名称</label>
        <input class="form-control" type="text" id="username" name="username" placeholder="用户名称" value="{$model.username|default=''}">
    </div>
    <div class="form-group">
        <label class="col-xs-12" for="password">登陆密码</label>
        <input class="form-control" type="text" id="password" name="password" placeholder="登陆密码" value="">
    </div>
    <div class="form-group">
        <label class="col-xs-12" for="role_id">所属角色</label>
        <select class="form-control" id="role_id" name="role_id" size="1">
            {foreach $roles as $role}
                <option value="{$role.id}" {if isset($model) AND $model.role_id eq $role.id}selected{/if}>{$role.name}</option>
            {/foreach}
        </select>
    </div>
</form>